broadway: fix use-after-free on read errors
authorPeter Wu <peter@lekensteyn.nl>
Thu, 23 Jul 2015 15:13:54 +0000 (17:13 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 26 Jul 2015 04:46:13 +0000 (00:46 -0400)
commitfffbe61c236500ec7600e3fbe248ebecfe799817
tree819dc9ed50299cf2e155dc2041f90b4641d23b72
parent030aa540ef9dbd405b422cb18305ff62c090c386
broadway: fix use-after-free on read errors

Call chain:
 - input_data_cb
   - broadway_server_read_all_input_nonblocking (input)
     - broadway_input_free (input)
       (now input is invalid)
     attempt to use input->active -> use-after-free

Make broadway_server_read_all_input_nonblocking return a boolean, TRUE
if the input was valid, FALSE otherwise. This allows input_data_cb to
detect whether the input was gone or not.

https://bugzilla.gnome.org/show_bug.cgi?id=741685
gdk/broadway/broadway-server.c